package com.rabbit.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import com.rabbit.R;
import com.rabbit.activity.ShopList;
import com.rabbit.base.TabFragment;
import com.rabbit.view.ButtomTagBarView;
import com.rabbit.view.LocalZoomView;

/**
 * LocalFragment
 * @author zhilei.liu
 * 2014-12-9下午3:36:51
 */
public class LocalFragment extends TabFragment{
    
    public static final String TAG = "Local";
    
    private View localRoot;
    private LocalZoomView mShop,mGroupBuy,mHome,mCompany,mSuggest;
    
    private ButtomTagBarView mButtomTagBarView;

    @Override
    public View getTableView(Context context, LayoutInflater inflater,
            View rootView) {
        mButtomTagBarView = (ButtomTagBarView) inflater.inflate(
                R.layout.main_tag_bar, (ViewGroup) rootView, false);
        mButtomTagBarView.setIconRes(R.drawable.local_tab);
        mButtomTagBarView.setTypeName(R.string.fragment_local);
        return mButtomTagBarView;
    }
    
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        
        localRoot = inflater.inflate(R.layout.local_fragmet, container, false);
        initView();
        initEvent();
        return localRoot;
    }



    public void initView(){
        mCompany = (LocalZoomView)localRoot.findViewById(R.id.zoom_local_company);
        mGroupBuy = (LocalZoomView)localRoot.findViewById(R.id.zoom_local_group_buy);
        mHome = (LocalZoomView)localRoot.findViewById(R.id.zoom_local_home);
        mShop = (LocalZoomView)localRoot.findViewById(R.id.zoom_local_shop);
        mSuggest = (LocalZoomView)localRoot.findViewById(R.id.zoom_local_suggest);
        mSuggest.setLineVisibilty(View.GONE);
        mSuggest.setDownTextVisibilty(View.GONE);
    }
    
    private void initEvent() {
        mShop.setOnClickListener(new OnClickListener() {
            
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), ShopList.class);
                startActivity(intent);
            }
        });
    }
}
